<%@page import="support.*, java.util.*" %>

<html>
 <head><title>Country of citizenship</title></head>
 <body>
 <%
 	String fName = request.getParameter("first");
 	session.setAttribute("first", fName);
 	String mInit = request.getParameter("middle");
 	session.setAttribute("middle", mInit);
 	String lName = request.getParameter("last");
 	session.setAttribute("last", lName);
 %>
 
 Please choose your country <%= fName %> <%= mInit %> <%= lName %><p>
 
 <%
  	Support s = new Support();
 
	String path1 = config.getServletContext().getRealPath("countries.txt");
	String path2 = config.getServletContext().getRealPath("universities.txt");
	String path3 = config.getServletContext().getRealPath("majors.txt");
	String path4 = config.getServletContext().getRealPath("specializations.txt");
 	
	/*countries for citizen*/
  	Vector c = s.getCountries(path1);
	out.println("<table border='1'>");
	for (int i = 0; i < c.size(); i++) {
		String temp = (String)c.get(i);
		if (i%3 == 0 && i != 0) out.println("</tr>");
		if (i%3 == 0) out.println("<tr>");
		out.println("<td><a href ='http://localhost:8080/A1/residence.jsp?citizen=" + temp + "'>" + temp + "</a></td>");	
	}
	
	out.println("</table>");
 
 
 
 
 %>
 </body>
</html>